import request from '@/utils/request.js'

/**
 * 采购相关
 */

// 获取采购项目信息(类别)
export const getPurchasingInfoApi = (params) => request({ url: `/web/purchasingProject/getPurchasingInfo`, method: 'get', params, loading: true })

// 生成采购单编号
export const getProcureOrderNoApi = (params) => request({ url: `/web/procureOrder/getProcureOrderNo`, method: 'get', params, loading: true })

// 关联船舶
export const relationBoatApi = (data) => request({ url: `/web/procureOrder/relationBoat`, method: 'post', data, loading: true })

// 修改采购单
export const editApi = (data) => request({ url: `/web/procureOrder/updateProcureOrder`, method: 'post', data, loading: true })

// 采购单详情
export const detailApi = (id) => request({ url: `/web/procureOrder/${id}`, method: 'get' })

// 删除采购单
export const deleteApi = (id) => request({ url: `/web/procureOrder/${id}`, method: 'DELETE', loading: true })

// 修改-增加采购明细
export const editOrderDetailApi = (data) => request({ url: `/web/procureOrder/operationAssistOrderDetail`, method: 'post', data })

// 删除采购单明细
export const deleteDetailApi = (params) => request({ url: `/web/procureOrder/deleteDetailPhysical`, method: 'get', params, loading: true })

// 批量修改采购项目明细分类
export const batchUpdateTypeApi = (params) => request({ url: `/web/procureOrder/batchUpdateType`, method: 'get', params, loading: true })

// 采购单列表
export const procureOrderListApi = (params, data) => request({ url: `/web/procureOrder/selectShcwProcureOrderList`, method: 'post', params, data, loading: true })

// 询价
export const invitationToQuoteApi = (data) => request({ url: `/web/procureOrder/invitationToQuote`, method: 'post', data, loading: true })

// 邀请报价采购单
export const queryInvitedOrderApi = (params, data) => request({ url: `/web/procureOrder/queryInvitedOrder`, method: 'post', params, data, loading: true })

// 分配报价员
export const headOfDistributionApi = (params) => request({ url: `/web/procureOrder/headOfDistribution`, method: 'get', params, loading: true })

// 参与报价
export const onlineQuoteApi = (params) => request({ url: `/web/procureQuotation/onlineQuote`, method: 'get', params, loading: true })

// 查询报价单详情
export const queryQuotationByIdApi = (params) => request({ url: `/web/procureQuotation/queryQuotationById`, method: 'get', params, loading: true })

// 查询报价单详情(船东)
export const viewOuotationApi = (params) => request({ url: `/web/procureQuotation/viewOuotation`, method: 'get', params, loading: true })

// 保存报价单
export const saveQuotationApi = (data) => request({ url: `/web/procureQuotation/saveQuotation`, method: 'post', data, loading: true })

// 提交报价单（详情
export const submitQuotationApi = (data) => request({ url: `/web/procureQuotation/submitQuotation`, method: 'post', data, loading: true })

// 提交报价单（列表
export const submitInListApi = (params) => request({ url: `/web/procureQuotation/submitInList`, method: 'get', params, loading: true })

// 修改报价单明细
export const updateQuotoDetailApi = (data) => request({ url: `/web/procureQuotation/updateQuotoDetail`, method: 'post', data, loading: true })

// 查看报价前置校验
export const viewBeforeApi = (data) => request({ url: `/web/procureQuotation/viewBefore`, method: 'post', data, loading: true })

// 查询收到的报价列表
export const procureQuotationQueryReceiveQuotaApi = (params, data) => request({ url: `/web/procureQuotation/queryReceiveQuota`, method: 'post', params, data, loading: true })

// 参与投标
export const joinBidApi = (params) => request({ url: `/web/procureQuotation/joinBid`, method: 'get', params, loading: true })

// 拒绝投标（放弃投标）
export const rejectionBidApi = (data) => request({ url: `/web/procureQuotation/rejectionBid`, method: 'post', data, loading: true })

// 确认中标操作
export const confirmQuotationApi = (data) => request({ url: `/web/procureQuotation/confirmQuotation`, method: 'post', data, loading: true })

// 确认中标操作
export const confirmQuotationApi2 = (data) => request({ url: `/web/assistQuotation/confirmQuotation`, method: 'post', data, loading: true })



// 发布的报价单
export const selectShcwQuotationProcureOrderListApi = (params, data) => request({ url: `/web/procureQuotation/selectShcwQuotationProcureOrderList`, method: 'post', params, data, loading: true })

// 接受中标
export const acceptanceQuotationApi = (params) => request({ url: `/web/procureQuotation/acceptanceQuotation`, method: 'get', params, loading: true })

// 拒绝中标
export const refusalQuotationApi = (data) => request({ url: `/web/procureQuotation/refusalQuotation`, method: 'post', data, loading: true })

// 可评价列表
export const queryAwaitingEvaluationApi = (params, data) => request({ url: `/web/procureQuotation/queryAwaitingEvaluation`, method: 'post', params, data, loading: true })

// 在线比价-采购报价
export const procureQuoteCompareApi = (data) => request({ url: `/web/comparePrice/procureQuoteCompare`, method: 'post', data })

// 导出报价
export const exportProcureQuoteApi = (params) => request({ url: `/web/procureQuotation/exportProcureQuote`, method: 'post', params, responseType: 'blob', loading: true })

// 采购报价单中船舶列表
export const getQuotaOrderShipApi = (data) => request({ url: `/web/procureQuotation/getQuotaOrderShip`, method: 'post', data: data || {} })

// 采购邀请报价中船舶列表
export const queryInvitedShipApi = (data) => request({ url: `/web/procureOrder/queryInvitedShip`, method: 'post', data: data || {} })

// 发布后编辑
export const inviteEditingApi = (params) => request({ url: `/web/procureQuotation/inviteEditing`, method: 'post', params })

// 邀请报价记录
export const queryQuoteRecordApi = (params) => request({ url: `/web/procureOrder/queryQuoteRecord`, method: 'get', params })
